package com.gitee.hermer.engine.jars.core.execute.callback;

import java.util.concurrent.TimeoutException;

import com.gitee.hermer.boot.jee.commons.utils.DateUtils;
import com.gitee.hermer.engine.jars.core.event.EngineHandleEvent;
import com.gitee.hermer.engine.jars.dependent.thread.pool.callback.CallableResult;

public abstract class EventCallableResult<V> extends CallableResult<V>{

	protected EngineHandleEvent event;

	public EventCallableResult(EngineHandleEvent event){
		this.event = event;
	}

	@Override
	public void onError(Throwable e) {
		if(e instanceof TimeoutException){
			error("事件ID[%s]|容器事件[%s]执行超时！ -> 当前时间 -> [%s]",e,event.getID(),event,DateUtils.getCurrentTime());
		}else{
			super.onError(e);
		}
	}

}
